package badugaserver;
import java.util.ArrayList;

/**
 * @author Wojtek N., Kamil M.
 * @version 0.7
 * The main class of the player hand.
 */
public class Hand 
{
	private ArrayList<Card> hand = new ArrayList<Card>();
	
	public Hand(Deck deck)
	{
		for(int i = 0; i < 4; i++)
		{
			hand.add(deck.drawFromDeck());
		}

	}
	
	public ArrayList<Card> getHand()
	{
		return hand;
	}
	
	public void setCard(int index, Card card)
	{
		hand.set(index%4, card);
	}
	
	public Card getCard(int index)
	{
		return hand.get(index%4);
	}
	
	public Card removeCard(int index)
	{
		return hand.remove(index%4);
	}
	
	public int size()
	{
		return hand.size();
	}
	
	public String toString(boolean which)
	{
		String temp ="";
		for(int i=0; i<hand.size(); i++)
		{
			temp = temp + getCard(i).toString(which);
		}
		return temp;
	}

}
